package com.ctvit.cch.web.controller;

import com.ctvit.cch.core.pojo.dto.creative.CreativeScriptSceneEditDTO;
import com.ctvit.cch.core.service.ICreativeScriptSceneService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 脚本场景Controller
 *
 * @author heyingcheng
 * @date 2025/10/11
 */
@RestController
@RequestMapping("/creative/script/scene")
public class CreativeScriptSceneController extends BaseController {

    private final ICreativeScriptSceneService creativeScriptSceneService;

    public CreativeScriptSceneController(ICreativeScriptSceneService creativeScriptSceneService) {
        this.creativeScriptSceneService = creativeScriptSceneService;
    }

    /** 
     * 修改脚本场景
     * 
     * @param dto 脚本场景信息
     * @return {@link AjaxResult} 修改结果
     */
    @PreAuthorize("@ss.hasPermi('creative:script:scene:edit')")
    @PostMapping("edit")
    public AjaxResult edit(@RequestBody @Validated CreativeScriptSceneEditDTO dto) {
        return toAjax(creativeScriptSceneService.edit(dto));
    }


}